Integrand size = 28, antiderivative size = 120 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {a^2 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {2 a b \sec ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d} \]
[Out]
Time = 0.18 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3169, 3853, 3855, 2686, 30, 2691} \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {a^2 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^2 \tan (c+d x) \sec (c+d x)}{2 d}+\frac {2 a b \sec ^3(c+d x)}{3 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {b^2 \tan (c+d x) \sec ^3(c+d x)}{4 d}-\frac {b^2 \tan (c+d x) \sec (c+d x)}{8 d} \]
[In]
[Out]
Rule 30
Rule 2686
Rule 2691
Rule 3169
Rule 3853
Rule 3855
Rubi steps \begin{align*} \text {integral}& = \int \left (a^2 \sec ^3(c+d x)+2 a b \sec ^3(c+d x) \tan (c+d x)+b^2 \sec ^3(c+d x) \tan ^2(c+d x)\right ) \, dx \\ & = a^2 \int \sec ^3(c+d x) \, dx+(2 a b) \int \sec ^3(c+d x) \tan (c+d x) \, dx+b^2 \int \sec ^3(c+d x) \tan ^2(c+d x) \, dx \\ & = \frac {a^2 \sec (c+d x) \tan (c+d x)}{2 d}+\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}+\frac {1}{2} a^2 \int \sec (c+d x) \, dx-\frac {1}{4} b^2 \int \sec ^3(c+d x) \, dx+\frac {(2 a b) \text {Subst}\left (\int x^2 \, dx,x,\sec (c+d x)\right )}{d} \\ & = \frac {a^2 \text {arctanh}(\sin (c+d x))}{2 d}+\frac {2 a b \sec ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d}-\frac {1}{8} b^2 \int \sec (c+d x) \, dx \\ & = \frac {a^2 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {2 a b \sec ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d} \\ \end{align*}
Time = 0.02 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {a^2 \text {arctanh}(\sin (c+d x))}{2 d}-\frac {b^2 \text {arctanh}(\sin (c+d x))}{8 d}+\frac {2 a b \sec ^3(c+d x)}{3 d}+\frac {a^2 \sec (c+d x) \tan (c+d x)}{2 d}-\frac {b^2 \sec (c+d x) \tan (c+d x)}{8 d}+\frac {b^2 \sec ^3(c+d x) \tan (c+d x)}{4 d} \]
[In]
[Out]
Time = 1.15 (sec) , antiderivative size = 118, normalized size of antiderivative = 0.98
method | result | size |
derivativedivides | \(\frac {a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {2 a b}{3 \cos \left (d x +c \right )^{3}}+b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) | \(118\) |
default | \(\frac {a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+\frac {2 a b}{3 \cos \left (d x +c \right )^{3}}+b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}\) | \(118\) |
parts | \(\frac {a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {b^{2} \left (\frac {\sin \left (d x +c \right )^{3}}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin \left (d x +c \right )^{3}}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )}{d}+\frac {2 a b \sec \left (d x +c \right )^{3}}{3 d}\) | \(123\) |
parallelrisch | \(\frac {-48 \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \left (a -\frac {b}{2}\right ) \left (a +\frac {b}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+48 \left (\frac {3}{4}+\frac {\cos \left (4 d x +4 c \right )}{4}+\cos \left (2 d x +2 c \right )\right ) \left (a -\frac {b}{2}\right ) \left (a +\frac {b}{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+64 a b \cos \left (2 d x +2 c \right )+16 a b \cos \left (4 d x +4 c \right )+\left (24 a^{2}-6 b^{2}\right ) \sin \left (3 d x +3 c \right )+\left (24 a^{2}+42 b^{2}\right ) \sin \left (d x +c \right )+128 b a \left (\cos \left (d x +c \right )+\frac {3}{8}\right )}{24 d \left (3+\cos \left (4 d x +4 c \right )+4 \cos \left (2 d x +2 c \right )\right )}\) | \(200\) |
risch | \(-\frac {i {\mathrm e}^{i \left (d x +c \right )} \left (12 a^{2} {\mathrm e}^{6 i \left (d x +c \right )}-3 b^{2} {\mathrm e}^{6 i \left (d x +c \right )}+12 a^{2} {\mathrm e}^{4 i \left (d x +c \right )}+21 b^{2} {\mathrm e}^{4 i \left (d x +c \right )}+64 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-12 a^{2} {\mathrm e}^{2 i \left (d x +c \right )}-21 b^{2} {\mathrm e}^{2 i \left (d x +c \right )}+64 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-12 a^{2}+3 b^{2}\right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {\ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right ) a^{2}}{2 d}-\frac {b^{2} \ln \left (i+{\mathrm e}^{i \left (d x +c \right )}\right )}{8 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{2 d}+\frac {b^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{8 d}\) | \(255\) |
norman | \(\frac {\frac {4 a b}{3 d}-\frac {\left (4 a^{2}-11 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{2 d}-\frac {\left (4 a^{2}-11 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{2 d}+\frac {\left (4 a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {\left (4 a^{2}+b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{11}}{4 d}+\frac {\left (4 a^{2}+9 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{4 d}+\frac {\left (4 a^{2}+9 b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{9}}{4 d}+\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}{3 d}-\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{10}}{d}+\frac {8 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}}{3 d}-\frac {4 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{d}+\frac {8 a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}}{3 d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{4} \left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{2}}-\frac {\left (4 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {\left (4 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) | \(343\) |
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.00 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {3 \, {\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 32 \, a b \cos \left (d x + c\right ) + 6 \, {\left ({\left (4 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, b^{2}\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \]
[In]
[Out]
Timed out. \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\text {Timed out} \]
[In]
[Out]
none
Time = 0.24 (sec) , antiderivative size = 129, normalized size of antiderivative = 1.08 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {3 \, b^{2} {\left (\frac {2 \, {\left (\sin \left (d x + c\right )^{3} + \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + \frac {32 \, a b}{\cos \left (d x + c\right )^{3}}}{48 \, d} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 249 vs. \(2 (108) = 216\).
Time = 0.33 (sec) , antiderivative size = 249, normalized size of antiderivative = 2.08 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {3 \, {\left (4 \, a^{2} - b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (4 \, a^{2} - b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 48 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{6} - 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 21 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 48 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 21 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 16 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 12 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 3 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 16 \, a b\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \]
[In]
[Out]
Time = 24.79 (sec) , antiderivative size = 216, normalized size of antiderivative = 1.80 \[ \int \sec ^5(c+d x) (a \cos (c+d x)+b \sin (c+d x))^2 \, dx=\frac {\left (a^2+\frac {b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7-4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (\frac {7\,b^2}{4}-a^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (\frac {7\,b^2}{4}-a^2\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3-\frac {4\,a\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{3}+\left (a^2+\frac {b^2}{4}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {4\,a\,b}{3}}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^2-\frac {b^2}{4}\right )}{d} \]
[In]
[Out]